<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <school></school>
        <hr>
    </div>
    <script>
        Vue.config.productionTip = false;
        const school = Vue.extend({
            template:
               `<div>
                   <h1>学校名称：{{schoolName}}</h1>
                   <h1>学校地址：{{address}}</h1>
                   <button @click="showAlert">点我弹窗</button>
                </div>`,
            data(){ 
                return {
                    schoolName:'尚硅谷',
                    address:'北京',
                }
            },
            methods: {
                showAlert(){
                    // this指向VueComponent实例对象
                    console.log(this.x);
                    alert("fjs");
                }
            },
        });
        console.log(school);

        let vm = new Vue({
            el: '#root',
            components:{
                school
            },
        });
        Vue.prototype.x = 88;
        console.log(Vue.prototype === school.prototype.__proto__);
        // true

    </script>
</body>
</html>